#!/usr/bin/env python3

class Student:
    name = 0

    def __init__(self, name='kyo'):
        self.name = name
        Student.name += 1

    def show(self):
        print("Student.name: ", Student.name, ", self.name: ", self.name)


def main():
    s = Student()
    o = Student('mary')
    c = Student('mary')
    d = Student('mary')
    #  print(type(Student))
    s.show()
    #  Student.name = "tom"
    o.show()

    #  类对象引用属性
    print(Student.__dict__)
    print(Student.name, id(Student.name))

    #  对象实例引用属性, 如果对象实例没有此属性会访问类对象的属性
    #  s.name = "tom"
    print(s.__dict__)
    print(s.name, id(s.name))

if __name__ == "__main__":
    main()
